﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CardLogistics.Web.Components;
using System.Data;

namespace CardLogistics.Web.MainPage.CardMaking.CardDemand
{
    public partial class DemandDetail : BasePage
    {
        private static readonly CardLogistics.DAL.Purchase.Purchase_DetailedData DAL = new DAL.Purchase.Purchase_DetailedData();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
            }
        }

        protected Dictionary<string, string> CardTypeList()
        {
            // var BranchArray = CardTypeList.ToDictionary(k => k.ID, k => k.Name);可以把数据库查出来的list转换成Dictionary
            Dictionary<string, string> cardTypeList = new Dictionary<string, string>();
            DataTable dt = CardLogistics.DAL.DbHelperSQL.GetQueryResult("select id,cardtypename from basic_cardtype where STATUS=0 and ISDELETE=0");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string id = dt.Rows[i]["id"].ToString();
                string cardtypename = dt.Rows[i]["cardtypename"].ToString();

                cardTypeList.Add(id, cardtypename);
            }
            return cardTypeList;
        }
    }
}